create external table jms_dm.dm_qxt_customer_new_detail_dt 
(
date_time               string COMMENT '业务日期' ,
ordersource_code        string COMMENT '平台code' ,
ordersource_name        string COMMENT '平台' ,
customer_province_id    string COMMENT '客户所属省id' ,
customer_province_desc  string COMMENT '客户所属省' ,
customer_city_id        string COMMENT '客户所属城市id' ,
customer_city_desc      string COMMENT '客户所属城市' ,
customer_area_id        string COMMENT '客户所属区县id' ,
customer_area_desc      string COMMENT '客户所属区县' ,
agent_code              string COMMENT '代理区编码' ,
agent_name              string COMMENT '代理区名字' ,
fran_code               string COMMENT '加盟商编码' ,
fran_name               string COMMENT '加盟商名字' ,
code                    string COMMENT '网点编码' ,
name                    string COMMENT '网点名字' ,
customer_code           string COMMENT '客户编码' ,
customer_name           string COMMENT '客户名字' ,
mall_id                 string COMMENT '商家ID' ,
mall_name               string COMMENT '商家名字' ,
customer_signed_date  date COMMENT '客户签约日期' ,
day_customer_waybill_sum   string COMMENT '运单总量',
virt_code string comment'虚拟代理区code',
virt_name string comment'虚拟代理区'
 )
comment '七星潭新增客户明细'
PARTITIONED BY ( dt string COMMENT '时间分区')
stored as parquet
LOCATION '/dw/hive/jms_dm.db/external/dm_qxt_customer_new_detail_dt'
TBLPROPERTIES (     'discover.partitions' = 'false',  'parquet.column.index.access' = 'true');

-- 新增字段
alter table jms_dm.dm_qxt_customer_new_detail_dt add columns (
virt_code string comment'虚拟代理区code',
virt_name string comment'虚拟代理区'
) cascade ;

-- 新增字段
alter table jms_dm.dm_qxt_customer_new_detail_dt add columns (
virt_code string comment'虚拟代理区code',
virt_name string comment'虚拟代理区'
) cascade ;
